#include <iostream>
#include <unordered_map>

using namespace std;

const int N = 1e9 + 7;

int main()
{
    int n;
    cin >> n;
    unordered_map<int, int> primes;
    while (n--)
    {
        int x;
        cin >> x;
        for (int i = 2; i <= x / i; ++i)
        {
            while (x % i == 0)
            {
                x /= i;
                primes[i]++;
            }
        }
        if (x > 1)
        {
            primes[x]++;
        }
    }

    long long ret = 1;
    for (auto prime : primes)
    {
        long long p = prime.first, a = prime.second;
        long long t = 1;
        while (a--)
        {
            t = (t * p + 1) % N;
        }
        ret = ret * t % N;
    }
    cout << ret << endl;
    return 0;
}